import Vue from "vue";

//启动器
import { App } from "@magustek/app-starter";
//麦杰UI组件库
import MagusUI from "@magustek/magus-ui";
//自定义主色调
import "@static/style/index.scss";
//核心模块包
import FrameworkCore from "@magustek/framework-core";
//皮肤主题包
import MagusIotUi from "@magustek/magusiot-theme-ui";
//系统管理包
import MaugsIotSystemUi from "@magustek/magusiot-system-ui";


import AppView from "@/app-main/App.vue";
import echarts from "echarts"; //引入echarts

//自定义登录页文件
// import Login from './login.vue'
//自定义首页文件
import Home from "./home.vue";
Vue.use(MagusUI);
Vue.config.productionTip = false;
const app = (window.app = new App());

Vue.prototype.$echarts = echarts;
//引用主题包
app.use(MagusIotUi, {
  /* login: Login,//自定义登录页样式(不使用则采用主题包默认首页)*/
  home: Home, //自定义首页(不使用则采用主题包默认首页)
  loginImg: require("../../public/static/images/loginImg.png"), //自定义登录页图片
  logo: require("../../public/static/images/logo.png"), //自定义Logo图片
});

let modules = [FrameworkCore, MaugsIotSystemUi];

// 扫描模块
let contexts = require.context("@", true, /^\.\/[^\/]*\/index\.js$/);
contexts.keys().forEach((key) => {
  let module = contexts(key).default;
  modules.push(module);
});

app.batchLoadModules(modules);

app.init(AppView);
